import os

file = "/Users/ddy/files.txt"

with open(file, '+r', encoding="utf8") as f:
    content = f.read()
    content = content.replace("\\", "/").replace("//", "/")
    f.seek(0, 0)  # 读写偏移位置移到最开始处
    f.write(content)
